import './assets/main.css';
import ElementPlus, { sliderEmits } from 'element-plus';
import 'element-plus/dist/index.css';

import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs';
import { createApp } from 'vue';
import { createPinia } from 'pinia';
import App from './App.vue';
import router from './router';

import { 
  Button,
  Swipe,
  SwipeItem,
  Col,
  Row, 
  Search,
  Tag,
  Cell,
  CellGroup,
  Tabbar, 
  TabbarItem,
  Sidebar, 
  SidebarItem,
  NavBar,
  Card,
  ActionBar, 
  ActionBarIcon, 
  ActionBarButton,
  Form, 
  Field,
  Popup,
  Stepper,
  Icon
} from 'vant';
import { Image as VanImage } from 'vant';
import 'vant/lib/index.css' // 引入 Vant 样式

const toTop = () => {
  window.scrollTo({
    top: 0,
    behavior: 'smooth'
  });
}
const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
};
app.use(createPinia());
app.use(router);
app.use(ElementPlus, {
  locale: zhCn,
  size: 'small',
  zIndex: 3000
});

app.use(Button);
app.use(Swipe);
app.use(SwipeItem);
app.use(Col);
app.use(Row);
app.use(Search);
app.use(Tag);
app.use(Cell);
app.use(CellGroup);
app.use(VanImage);
app.use(Tabbar);
app.use(TabbarItem);
app.use(Sidebar);
app.use(SidebarItem);
app.use(NavBar);
app.use(Card);
app.use(ActionBar);
app.use(ActionBarIcon);
app.use(ActionBarButton);
app.use(Form);
app.use(Field);
app.use(Popup);
app.use(Stepper);
app.use(Icon);

app.mount('#app');
